package c.i.b.b.c;

import android.content.Context;
import c.i.a.a.b;
import com.huawei.agconnect.exception.AGCServerException;

public class a extends b {
    public Context o = null;

    public a(Context context, String str) {
        super(context, str);
        this.o = context;
        StringBuilder stringBuilder = new StringBuilder();
        String str2 = "";
        stringBuilder.append(c.i.a.a.a.a != 0 ? str2 : "https://bds.snssdk.com");
        stringBuilder.append("/v2/r");
        try {
            str2 = this.o.getPackageManager().getPackageInfo(this.o.getPackageName(), 0).versionName;
        } catch (Exception e) {
            e.printStackTrace();
        }
        StringBuilder i = c.b.a.a.a.i(c.b.a.a.a.E("?os=0&ver=0.6.11.30.08-PGL-Do-fix3&m=2", "&app_ver=", str2), "&region=");
        i.append(c.i.b.b.a.b.a(this.o));
        i = c.b.a.a.a.i(i.toString(), "&appkey=");
        i.append(com.pgl.sys.ces.b.b());
        i = c.b.a.a.a.i(i.toString(), "&did=");
        i.append(com.pgl.sys.ces.b.c());
        stringBuilder.append(i.toString());
        this.c = stringBuilder.toString();
    }

    public boolean b(int i, byte[] bArr) {
        if (i == AGCServerException.OK && bArr != null) {
            try {
                if (bArr.length > 0 && bArr.length > 0) {
                    if (bArr.length == 37) {
                        com.pgl.sys.ces.b.c = true;
                    } else {
                        com.pgl.sys.ces.b.c = false;
                    }
                }
            } catch (Throwable unused) {
                com.pgl.sys.ces.b.c = false;
            }
        }
        return true;
    }
}
